home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / etc / init.d / stop-bootlogd-single < prev    next >
Text File  |  2008-10-14  |  1KB  |  49 lines

  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          stop-bootlogd-single
  4. # Required-Start:    $remote_fs $all
  5. # Required-Stop:
  6. # Default-Start:     S
  7. # Default-Stop:
  8. # Short-Description: Stop bootlogd in single user mode
  9. # Description:       See the init.d/bootlogd script
  10. ### END INIT INFO
  11. #
  12. # This has to run in the boot sequence (rcS.d), and not in the "single
  13. # user" sequence (rc1.d), because rc1.d/ is not used when booting into
  14. # single user.  "grep :[S1]: /etc/inittab" show that single user is just
  15. # a call to /sbin/sulogin, while runlevel 1 is a call to
  16. # "/etc/init.d/rc 1" which in the end switches to runlevel S to run
  17. # /sbin/sulogin.
  18.  
  19. PATH=/sbin:/usr/sbin:/bin:/usr/bin
  20. NAME=stop-bootlogd-single
  21. DAEMON=/sbin/bootlogd
  22.  
  23. [ -x "$DAEMON" ] || exit 0
  24.  
  25. case "$1" in
  26.   start)
  27.     single=false
  28.     for word in $(cat /proc/cmdline); do
  29.         case "$word" in
  30.         S|single|1)
  31.             single=true
  32.         ;;
  33.         esac
  34.     done
  35.     if [ true = "$single" ] ; then
  36.         /etc/init.d/bootlogd stop
  37.     fi
  38.     ;;
  39.   stop|restart|force-reload)
  40.     # No-op
  41.     ;;
  42.   *)
  43.     echo "Usage: $NAME {start|stop|restart|force-reload}" >&2
  44.     exit 3
  45.     ;;
  46. esac
  47.  
  48. :
  49.